package www.lagou.entity;

import java.util.Objects;

/**
 * transaction 表对应的 JavaBean 类。
 */
public class Transaction {
    private int id;
    private String cardid;
    private String tratype;
    private double tramoney;
    private String tradate;

    public Transaction() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCardid() {
        return cardid;
    }

    public void setCardid(String cardid) {
        this.cardid = cardid;
    }

    public String getTratype() {
        return tratype;
    }

    public void setTratype(String tratype) {
        this.tratype = tratype;
    }

    public double getTramoney() {
        return tramoney;
    }

    public void setTramoney(double tramoney) {
        this.tramoney = tramoney;
    }

    public String getTradate() {
        return tradate;
    }

    public void setTradate(String tradate) {
        this.tradate = tradate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Transaction that = (Transaction) o;
        return id == that.id &&
                Double.compare(that.tramoney, tramoney) == 0 &&
                Objects.equals(cardid, that.cardid) &&
                Objects.equals(tratype, that.tratype) &&
                Objects.equals(tradate, that.tradate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, cardid, tratype, tramoney, tradate);
    }

    @Override
    public String toString() {
        return "Transaction{" +
                "id=" + id +
                ", cardid='" + cardid + '\'' +
                ", tratype='" + tratype + '\'' +
                ", tramoney=" + tramoney +
                ", tradate='" + tradate + '\'' +
                '}';
    }
}
